package com.atguigu.spring.bean;

/**
 * @author 孙志鹏
 * @create 2021-06-13 10:49
 */
public class BeanLifeCycle {

    private String name;

    public BeanLifeCycle() {
        System.out.println("类初始化第一步：调用无参数的构造器");
    }


    public void setName(String name) {
        System.out.println("类初始化第二步：调用set方法");
        this.name = name;
    }

    public void initMethod() {
        System.out.println("类初始化第三步: 调用初始化方法");
    }

    public void destroyMethod() {
        System.out.println("类初始化第五步: 调用销毁方法");
    }
}
